<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    let arr = [];
    arr.push(1);
    arr.push("a", "你", "好");
    arr[arr.length] = "aa";
    arr.unshift(2);
    arr.unshift(3, 4, "5");
    arr.splice(0, 0, "6", "7");
    arr.splice(arr.length, 0, "8", "9");
    console.log(arr);

    let obj = {
        name: "张三",
        age: 18
    };
    delete obj.name;
    console.log(obj);
    delete arr[0];//不推荐使用，不会引起数组的长度变化
    arr.pop();//弹出最底部的一个
    arr.pop();
    arr.shift();//弹出最顶部的一个
    arr.splice(0, 1);//从0元素开始删除1个
    console.log(arr);
    arr.splice(4, 2);//从索引为4的元素开始删除2个
    console.log(arr);

    arr[3] = "haha";
    arr.splice(4, 1, "这是新的");
    console.log(arr);

    let arr1 = [];
    console.log(arr1.pop());

    //只查找最近一个
    let find = arr.find(function (value, index, array) {
        if (parseInt(value) > 4) {
            return value;
        }
    })
    console.log(find);

    console.log(arr.includes("a"));
    console.log(arr.includes("aa"));

</script>
</body>
</html>